package com.integralPerformance.pojo.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 公共服务信息维护
 * @TableName service_info
 */
@TableName(value ="service_info")
@Data
public class ServiceInfo implements Serializable {
    /**
     * 唯一标识符
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 教师id
     */
    private String teacherId;

    /**
     * 服务岗位id
     */
    private String serviceBaseId;

    /**
     * 年度
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private String year;

    /**
     * 服务时长或次数（学年、门数）,默认为 1
     */
    private BigDecimal serverLength;

    /**
     * 备注
     */
    private String note;

    /**
     * 上报人
     */
    private String reporter;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ServiceInfo other = (ServiceInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
            && (this.getServiceBaseId() == null ? other.getServiceBaseId() == null : this.getServiceBaseId().equals(other.getServiceBaseId()))
            && (this.getYear() == null ? other.getYear() == null : this.getYear().equals(other.getYear()))
            && (this.getServerLength() == null ? other.getServerLength() == null : this.getServerLength().equals(other.getServerLength()))
            && (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
            && (this.getReporter() == null ? other.getReporter() == null : this.getReporter().equals(other.getReporter()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        result = prime * result + ((getServiceBaseId() == null) ? 0 : getServiceBaseId().hashCode());
        result = prime * result + ((getYear() == null) ? 0 : getYear().hashCode());
        result = prime * result + ((getServerLength() == null) ? 0 : getServerLength().hashCode());
        result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
        result = prime * result + ((getReporter() == null) ? 0 : getReporter().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", teacherId=").append(teacherId);
        sb.append(", serviceBaseId=").append(serviceBaseId);
        sb.append(", year=").append(year);
        sb.append(", serverLength=").append(serverLength);
        sb.append(", note=").append(note);
        sb.append(", reporter=").append(reporter);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}